﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NCS_CS
{
    public partial class FormTestCurve : Form
    {
        double sx = 0;
        public FormTestCurve()
        {
            InitializeComponent();
        }

        private void FormTestCurve_Load(object sender, EventArgs e)
        {
            this.mcurve1.setLineCount(1);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            System.DateTime n = System.DateTime.Now;
            sx = n.ToOADate()*100000 ;
            double x = 0, y = 0;
            //double.TryParse(this.textBox1.Text, out x);
            //double.TryParse(this.textBox2.Text, out y);
            Random r = new Random();
            y = r.NextDouble();
            this.mcurve1.tmplineaddpoint(x,y, 0);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double x = 0, y = 0;
            //double.TryParse(this.textBox1.Text, out x);
            Random r = new Random();
            System.DateTime n = System.DateTime.Now;
            x = n.ToOADate() * 100000 - sx;
            //double.TryParse(this.textBox2.Text, out y);
            y = r.NextDouble(); y = y * r.NextDouble() * 10;
            this.mcurve1.tmplineaddpoint(x, y, 0);
            System.Diagnostics.Debug.Print(x.ToString()+","+y.ToString()+"\n");

        }

        private void button3_Click(object sender, EventArgs e)
        {
            double x = 0, y = 0;
            //double.TryParse(this.textBox1.Text, out x);
            Random r = new Random();
            System.DateTime n = System.DateTime.Now;
            x = n.ToOADate() * 100000 - sx;
            double.TryParse(this.textBox2.Text, out y);
            //y = r.NextDouble(); y = y * r.NextDouble() * 10;
            this.mcurve1.tmplineaddpoint(x, y, 0);
            System.Diagnostics.Debug.Print(x.ToString() + "," + y.ToString() + "\n");
        }
    }
}
